<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 填写内容让下面代码支持
        a.name = "name1";
        b.name = "name2";
            function obj(name) {
                (1)
            }
        // obj.(2) = "name2";
        var a = obj("name1");
        var b = new obj;
        // 答案：（1）：
        if (name) {
            this.name = name;
        }
        return this;
        (2)
         prototype.name
    </script>
</body>

</html>